package com.hfzy.ihk.common.core.elasticsearch.entity;


import com.hfzy.ihk.common.core.elasticsearch.enums.VersionOperation;
import com.hfzy.ihk.common.facade.BaseEntity;
import com.hfzy.ihk.common.facade.elasticsearch.ElasticsearchTableOperation;
import com.hfzy.ihk.common.facade.elasticsearch.ElasticsearchVersionRedisKey;
import com.hfzy.ihk.common.facade.elasticsearch.entity.ElasticsearchTable;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * <p>
 * 
 * </p>
 * 版本控制
 * @author wws
 * @since 2018-01-13
 */

@Document(indexName = "#{elasticSearchConfig.indexName()}_version_error_msg",shards = 24,replicas = 2, type = "data")
public class VersionCtrlErrorMsg implements BaseEntity {

    private static final long serialVersionUID = 1L;

	@Id
	private String id;

	//@Version
	private Long version = 1L;

	@Field(type = FieldType.Keyword)
	private String redisKey;

	@Field(type = FieldType.Keyword)
	private String optTable;

	/**操作*/
	@Field(type = FieldType.Keyword)
	private String versionOpt;

	@Field(type = FieldType.Keyword)
	private String dataId;

	/**回滚值*/
	private Integer rollbackValue;

	private String exceptionMsg;

	/*重试次数*/
	private int retryTimes = 0;

	@Override
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

	public String getOptTable() {
		return optTable;
	}

	public void setOptTable(String optTable) {
		this.optTable = optTable;
	}

	public String getDataId() {
		return dataId;
	}

	public void setDataId(String dataId) {
		this.dataId = dataId;
	}

	public String getExceptionMsg() {
		return exceptionMsg;
	}

	public void setExceptionMsg(String exceptionMsg) {
		this.exceptionMsg = exceptionMsg;
	}

	public int getRetryTimes() {
		return retryTimes;
	}

	public void setRetryTimes(int retryTimes) {
		this.retryTimes = retryTimes;
	}

	public String getVersionOpt() {
		return versionOpt;
	}

	public void setVersionOpt(String versionOpt) {
		this.versionOpt = versionOpt;
	}

	public String getRedisKey() {
		return redisKey;
	}

	public void setRedisKey(String redisKey) {
		this.redisKey = redisKey;
	}

	public Integer getRollbackValue() {
		return rollbackValue;
	}

	public void setRollbackValue(Integer rollbackValue) {
		this.rollbackValue = rollbackValue;
	}

	@Override
	public String toString() {
		return "VersionCtrlErrorMsg{" +
			", id=" + id +
			", dataId=" + dataId +
			"}";
	}
}
